From: Didier Roche Date: Fri, 30 Mar 2018 07:44:14 +0000 (+0200) Subject: ui: Theme lookup should respect XDG_DATA_DIRS X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~929^2~5^2~105 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d6d09fd3c82dd39dac1a764073040b57baeb8659;p=gnome-shell.git ui: Theme lookup should respect XDG_DATA_DIRS Modes, extensions and other GNOME Shell assets are searched in appropriate subdirectories of each directory in XDG_DATA_DIRS, falling back to global.datadir. However, this isn't the case for themes, which are currently always expected in global.datadir, even when referenced by a mode in a different XDG_DATA_DIR. The fix is to have the theme finding pattern follow the same logic as other elements. Fixes #167. --- diff --git a/js/ui/main.js b/js/ui/main.js index 2cfe941be..d86cf9e81 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -256,6 +256,14 @@ function _getStylesheet(name) { if (stylesheet.query_exists(null)) return stylesheet; + let dataDirs = GLib.get_system_data_dirs(); + for (let i = 0; i < dataDirs.length; i++) { + let path = GLib.build_filenamev([dataDirs[i], 'gnome-shell', 'theme', name]); + let stylesheet = Gio.file_new_for_path(path); + if (stylesheet.query_exists(null)) + return stylesheet; + } + stylesheet = Gio.File.new_for_path(global.datadir + '/theme/' + name); if (stylesheet.query_exists(null)) return stylesheet;